package services;

import java.util.List;

import javax.ejb.Remote;

import entities.Administrator;
import entities.Event;
import entities.Match;
import entities.Player;
import entities.PlayerEvent;
import entities.Referee;
import entities.Staff;
import entities.Team;
import entities.Tournament;
import entities.User;
import enums.MatchStatus;
import enums.TournamentStatus;

@Remote
public interface WebAction {

	// EVENT
	public void createEvent(Event entity);
	public void editEvent(Event entity);
	public void removeEvent(Event entity);
	public Event findEvent(Object id);
	public List<Event> findAllEvents();
	public List<Event> findRangeEvents(int[] range);
	public int countEvents();

	// MATCH
	public void createMatch(Match entity);
	public void editMatch(Match entity);
	public void removeMatch(Match entity);
	public Match findMatch(Object id);
	public List<Match> findAllMatchs();
	public List<Match> findRangeMatchs(int[] range);
	public int countMatchs();

	//PLAYER
	public void createPlayer(Player entity);
	public void editPlayer(Player entity);
	public void removePlayer(Player entity);
	public Player findPlayer(Object id);
	public List<Player> findAllPlayers();
	public List<Player> findRangePlayers(int[] range);
	public int countPlayers();

	//PLAYEREVENT
	public void createPlayerEvent(PlayerEvent entity);
	public void editPlayerEvent(PlayerEvent entity);
	public void removePlayerEvent(PlayerEvent entity);
	public PlayerEvent findPlayerEvent(Object id);
	public List<PlayerEvent> findAllPlayerEvents();
	public List<PlayerEvent> findRangePlayerEvents(int[] range);
	public int countPlayerEvents();

	//REFEREE
	public void createReferee(Referee entity);
	public void editReferee(Referee entity);
	public void removeReferee(Referee entity);
	public Referee findReferee(Object id);
	public List<Referee> findAllReferees();
	public List<Referee> findRangeReferees(int[] range);
	public int countReferees();

	//STAFF
	public void createStaff(Staff entity);
	public void editStaff(Staff entity);
	public void removeStaff(Staff entity);
	public Staff findStaff(Object id);
	public List<Staff> findAllStaffs();
	public List<Staff> findRangeStaffs(int[] range);
	public int countStaffs();

	//TEAM
	public void createTeam(Team entity);
	public void editTeam(Team entity);
	public void removeTeam(Team entity);
	public Team findTeam(Object id);
	public List<Team> findAllTeams();
	public List<Team> findRangeTeams(int[] range);
	public int countTeams();

	//TOURNAMENT
	public void createTournament(Tournament entity);
	public void editTournament(Tournament entity);
	public void removeTournament(Tournament entity);
	public Tournament findTournament(Object id);
	public List<Tournament> findAllTournaments();
	public List<Tournament> findRangeTournaments(int[] range);
	public int countTournaments();

	//USER
	public void createUser(User entity);
	public void editUser(User entity);
	public void removeUser(User entity);
	public User findUser(Object id);
	public List<User> findAllUsers();
	public List<User> findRangeUsers(int[] range);
	public int countUsers();

	//ADMINISTRATOR
	public void createAdministrator(Administrator entity);
	public void editAdministrator(Administrator entity);
	public void removeAdministrator(Administrator entity);
	public Administrator findAdministrator(Object id);
	public List<Administrator> findAllAdministrator();
	public List<Administrator> findRangeAdministrator(int[] range);
	public int countAdministrator();

	// Custom
	public List<Referee> getListRefereeByFlagActivated();
	public List<Tournament> getListTournamentByFlagActivated();
	public List<Team> getListTeamByFlagActivatedByTournament(Tournament oneTournament);
	public List<Referee> getListRefereeByFlagActivatedByTournament(Tournament oneTournament);
	public long getCountTeamByTournamentByFlagActivated(Tournament oneTournament);
	public List<Match> getListMatchByFlagActivatedByTournament(Tournament tournament);
	public List<Match> getListMatchByFlagActivatedByTournamentAndByStatus(Tournament tournament, MatchStatus preparation);
	public List<Tournament> getListTournamentByFlagActivatedByTournamentStatus(TournamentStatus status);
}